package com.dhcc.demo.webservice.config;

import javax.xml.ws.Endpoint;

import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.dhcc.demo.webservice.HelloWorld;
import com.dhcc.demo.webservice.HelloWorldImpl;

@Configuration
public class WebServiceConfig {
    @Autowired
    private SpringBus springBus;
	/** JAX-WS helloWorld**/
	@Bean
	public HelloWorld helloWorld() {
		return new HelloWorldImpl();
	}

	@Bean
	public Endpoint helloWorldEndpoint() {
		EndpointImpl endpoint = new EndpointImpl(springBus, helloWorld());
		endpoint.publish("/helloWorld");
		return endpoint;
	}
}